package com.study.design.pattern.pattern.behavioral.mediator;

/**
 * @Author: gongsl
 * @Date: 2025-03-25 21:46
 * @description: 具体同事类
 */
public class ChatUser extends User {
    public ChatUser(ChatMediator mediator, String name) {
        super(mediator, name);
    }

    @Override
    public void sendMessage(String message) {
        System.out.println("[" + name + "]发送消息: " + message);
        mediator.sendMessage(message, this);
    }

    @Override
    public void receiveMessage(String message) {
        System.out.println(name + " 收到消息: " + message);
    }
}
